(ispell-get-word): Return markers for start and end positions.
authorRichard M. Stallman <rms@gnu.org>
Fri, 18 May 2007 22:31:48 +0000 (22:31 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 18 May 2007 22:31:48 +0000 (22:31 +0000)
(ispell-word): Assume END is a marker.

lisp/textmodes/ispell.el

index e4b2dd9f040cf28b86ebc0370345eb34ec0c94cc..b274185bf177d820088e619afd7e518eb4f76c04 100644 (file)
@@ -1669,7 +1669,7 @@ quit          spell session exited."
                          ;; to avoid collapsing markers before and after
                          ;; into a single place.
                          (ispell-insert-word new-word)
-                         (delete-region (point) (+ (point) (- end start)))
+                         (delete-region (point) end)
                          ;; It is meaningless to preserve the cursor position
                          ;; inside a word that has changed.
                          (setq cursor-location (point))
@@ -1751,8 +1751,8 @@ which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'."
            ;; return dummy word when just flagging misspellings
            (list "" (point) (point))
          (error "No word found to check!"))
-      (setq start (match-beginning 0)
-           end (point)
+      (setq start (copy-marker (match-beginning 0))
+           end (point-marker)
            word (buffer-substring-no-properties start end))
       (list word start end))))